<div>
  <h1>moduleList</h1>
  <el-row style="text-align: right" >
    <el-button size="medium" type="primary" @click="onPushEvent()" >新建事件</el-button>
    <el-button size="medium" type="primary" @click="dialogPublicVisible = true" >共享模块</el-button>
  </el-row>

  <el-dialog title="新建事件" :visible.sync="dialogPushVisible">
    <el-tabs type="border-card">
      <el-tab-pane label="配置">
        <el-form ref="form" :model="eventForm" label-width="80px">
          <el-form-item label="事件名称" :label-width="formLabelWidth" >
            <el-input v-model="form.name" placeholder="请输入事件名称" ></el-input>
          </el-form-item>

          <el-form-item label="资产类型" :label-width="formLabelWidth" >
            <el-select v-model="form.stockType" filterable placeholder="请选择资产类型">
              <el-option label="股票" value="stock"></el-option>
            </el-select>
          </el-form-item>

          <el-form-item label="事件类型" :label-width="formLabelWidth" >
            <el-select v-model="form.type" filterable placeholder="请选择事件类型">
              <el-option label="买入" value="buy"></el-option>
              <el-option label="止盈" value="stopProfit"></el-option>
              <el-option label="止损" value="stopLoss" ></el-option>
              <el-option label="选股" value="filter" ></el-option>
            </el-select>
          </el-form-item>

          <el-form-item :label-width="formLabelWidth">
            <el-button size="medium" type="primary" @click="onAddTechnical()" >添加技术指标</el-button>
          </el-form-item>

          <template v-for="(item, index) of eventForm.list" >
            <el-form-item label="创建指标" :label-width="formLabelWidth" >
              <el-select v-model="form.technical" filterable placeholder="请选择指标">
                <el-option label="MA" value="ma"></el-option>
                <el-option label="MACD" value="macd" ></el-option>
                <el-option label="BOLL" value="boll" ></el-option>
              </el-select>

              <el-input type="number" v-model="item.value" autocomplete="off" placeholder="请选择数值" ></el-input>

              <el-select v-model="form.direction" filterable placeholder="请选择方向" >
                <el-option label="金叉" value="jincha" ></el-option>
                <el-option label="死叉" value="sicha" ></el-option>
              </el-select>
            </el-form-item>
          </template>

        </el-form>
      </el-tab-pane>
      <el-tab-pane label="代码">
        代码
      </el-tab-pane>
      <el-tab-pane label="说明">
        <el-input
          resize="none"
          type="textarea"
          :rows="13"
          placeholder="请输入内容"
          v-model="textarea">
        </el-input>
      </el-tab-pane>
    </el-tabs>

    <div slot="footer" class="dialog-footer">
      <el-button @click="dialogFormVisible = false">取 消</el-button>
      <el-button type="primary" @click="onPushTrade()">确 定</el-button>
    </div>
  </el-dialog>



  <el-dialog title="共享模块" :visible.sync="dialogPublicVisible">
    <el-form ref="form" :model="form" label-width="80px">
      <el-form-item label="模块名称" :label-width="formLabelWidth" >
        <el-input v-model="form.name" placeholder="请输入模块名称" ></el-input>
      </el-form-item>

      <el-form-item label="选择事件" :label-width="formLabelWidth" >
        <el-select v-model="form.region" filterable placeholder="请选择事件" >
          <el-option label="5日上穿10日均线金叉买入/死叉卖出" value="1"></el-option>
          <el-option label="boll张开买入" value="2" ></el-option>
          <el-option label="其他" value="3" ></el-option>
        </el-select>
      </el-form-item>

      <el-form-item label="是否免费" :label-width="formLabelWidth" >
        <el-switch v-model="form.free"  ></el-switch>
      </el-form-item>

      <el-form-item v-show="!form.free" label="价格" :label-width="formLabelWidth" >
        <el-input v-model="form.price" placeholder="请输入价格 (使用quantCoin支付)" ></el-input>
      </el-form-item>
      <!-- <el-form-item label="" >
        <el-checkbox-group v-model="form.type">
          <el-checkbox label="左侧趋势" name="type"></el-checkbox>
          <el-checkbox label="右侧趋势" name="type"></el-checkbox>
          <el-checkbox label="超短线" name="type"></el-checkbox>
          <el-checkbox label="价值投资" name="type"></el-checkbox>
        </el-checkbox-group>
      </el-form-item> -->
      <el-form-item label="适合风格" :label-width="formLabelWidth" >
        <el-radio-group v-model="form.resource">
          <el-radio label="左侧趋势"></el-radio>
          <el-radio label="右侧趋势"></el-radio>
          <el-radio label="超短线"></el-radio>
          <el-radio label="价值投资"></el-radio>
        </el-radio-group>
      </el-form-item>

      <el-form-item label="模块说明" :label-width="formLabelWidth" >
        <el-input
          resize="none"
          type="textarea"
          :rows="4"
          placeholder="请输入内容"
          v-model="textarea">
        </el-input>
      </el-form-item>
    </el-form>

    <div slot="footer" class="dialog-footer">
      <el-button @click="dialogFormVisible = false">取 消</el-button>
      <el-button type="primary" @click="onPushTrade()">确 定</el-button>
    </div>
  </el-dialog>
</div>
